/**
 *
 * Copyright Pact Lab of H.I.T.
 *
 * Designed and Implemented by Grid Researching Group, 
 * Pact Lab, Harbin
 * 
 * This Project is part of the national 973 Project:
 * Internet Based Virtual Computing Environment
 *
 * http://pact518.hit.edu.cn
 * 
 * Author:       Meteor <meteorlxk@gmail.com> 
 * Copyright:    pact518 
 * Version:      1.0
 * Created:      2009-4-7 
 * LastModified: 2009-4-7
 */
package edu.hit.pact.pgse.communication.message;

import edu.hit.pact.pgse.bean.TaskPiece;

/**
 * 
 * This message is only used for Master send TaskPush Command to Crawler.
 * 
 * @author Meteor
 */
public class TaskPiecePushMessage extends AbstractMessage{

	private static final long serialVersionUID = -180564521849582515L;
	
	private TaskPiece piece;

	/**
	 * @param piece
	 */
	public TaskPiecePushMessage(TaskPiece piece) {
		super(COMMUNICATION_TYPE.TASK_PUSH, true);
		this.piece = piece;
	}

	/**
	 * @return the piece
	 */
	public TaskPiece getPiece() {
		return piece;
	}
	
    @Override
    public String toString() {
        // it is a good practice to create toString() method on message classes.
        return "(" + this.getType() + ")\n " + piece.toString();
    }
	
}
